<!DOCTYPE html>
<html>
	<head>
    	<?php setlocale(LC_TIME,NULL); ?>
        <style>
        	body{
				font:Arial;
				font-size:10px;
			}
			.head-surat{
				float:left;
				text-align:center;
				margin-top:-6%;
			}
			#title-surat{
				text-align:center;
				font-size:11px;
				margin-top:6%;
			}
			.table-list{
				border-collapse:collapse;
			}
			.table-list tr td{
				border:1px solid #000;
			}
			#head-table{
				text-align:center;
				font-weight:bold;
				font-size:9px;
			}
			#footer-left{
				float:left;
				left:50%;
				text-align:center;
				font-size:11px;
				padding-left:10%;
			}
			#footer-right{
				float:right;
				right::50%;
				text-align:center;
				font-size:11px;
				padding-right:10%;
			}
			.cap{
				text-transform:capitalize !important;
			}
			.line-separtor{
				height:1px;
				border-bottom:1px solid #000;
			}
        </style>
    </head>
    <body onload="window.print();">
    	<div class="head-surat">
        	<b>
            	<?php echo @$surat[0]['baris_pertama'];?><br/>
				<?php if(substr(@$surat[0]['nama_sektor'], 0, 6) == "RESORT" ):?>
					<?php echo @$surat[0]['nama_sektor'];?><br/>
				<?php else:?>
					<?php echo @$surat[0]['baris_kedua'];?><br/>
					<?php echo @$surat[0]['nama_sektor'];?><br/>
				<?php endif;?>
                <div class="line-separtor"></div>
            </b>
        </div>
    	<div id="title-surat">
        	<b>
            	DATA PENGELUARAN SKCK BULAN:
        		<?php echo strtoupper(strftime("%B",strtotime(@$results[0]['tgl_terbit_police'])));?> <?php echo @$results[0]['tahun']?><br/>
				<?php if(substr(@$surat[0]['nama_sektor'], 0, 6) == "RESORT" ):?>
					<?php echo str_replace("RESORT","POLRES",@$surat[0]['nama_sektor'])?>
				<?php else:?>
					<?php echo str_replace("SEKTOR","POLSEK",@$surat[0]['nama_sektor'])?>
				<?php endif;?>
            </b>
        </div>
        <br/>
    	<table class="table-list" width="100%" border="0">
            <tr id="head-table">
                <td>No.</td>
                <td>Tgl. Terbit</td>
                <td>No. Agenda</td>
                <td>Nama</td>
                <td>Tempat, Tanggal Lahir</td>
                <td>Alamat</td>
                <td>Keperluan</td>
                <td>Nomor Seri Blangko</td>
				<td>No. Kwitansi</td>
            </tr>
            <tr id="head-table">
                <td>1</td>
                <td>2</td>
                <td>3</td>
                <td>4</td>
                <td>5</td>
                <td>6</td>
                <td>7</td>
                <td>8</td>
				<td>9</td>
            </tr>
			<?php $i=1;?>
            <?php foreach ($results as $row):?>
            <tr>
                <td align="center"><?php echo $i;?></td>
                <td><?php echo strftime("%d %B %Y",strtotime($row['tgl_terbit_police']))?></td>
                <td align="center"><?php echo $row['no_agenda']?></td>
                <td><?php echo $row['nama_pengaju']?></td>
                <td><?php echo $row['tempat_lahir_pengaju']?>,<?php echo strftime("%d %B %Y",strtotime($row['tgl_lahir_pengaju']))?></td>
                <td><?php echo $row['alamat_pengaju']?></td>
                <td><?php echo $row['keperluan']?></td>
                <td align="center"><?php echo $row['no_seri']?></td>
				<td align="center"><?php echo $row['no_kwitansi']?></td>
            </tr>
            <?php $i++;?>
            <?php endforeach?>
        </table>
        <br/>
        <div id="footer-left">
       		Mengetahui:<br/>
        	<?php echo strtoupper(@$penandatangan_kiri[0]['jabatan_penandatangan'])?>
            <br/>
            <br/>
            <br/>
            <br/>
            <u>
				<?php echo strtoupper(@$penandatangan_kiri[0]['nama_penandatangan'])?>
            </u>
            <br/>
            <?php echo strtoupper(@$penandatangan_kiri[0]['no_penandatangan'])?>
        </div>
        <div id="footer-right">
        	<div class="cap">
            	<?php if(substr(@$surat[0]['nama_sektor'], 0, 6) == "RESORT" ):?>
					<?php echo str_replace("RESORT","",@$surat[0]['nama_sektor'])?>
				<?php else:?>
					<?php echo str_replace("SEKTOR","",@$surat[0]['nama_sektor'])?>
				<?php endif;?>, 
				<?php echo strftime("%d %B %Y",strtotime(date('d-m-Y')))?>
            </div>
        	<?php echo strtoupper(@$penandatangan_kanan[0]['jabatan_penandatangan'])?>
            <br/>
            <br/>
            <br/>
            <br/>
            <u>
				<?php echo strtoupper(@$penandatangan_kanan[0]['nama_penandatangan'])?>
            </u>
            <br/>
            <?php echo strtoupper(@$penandatangan_kanan[0]['no_penandatangan'])?>
        </div>
    </body>
</html>


